package com.woniuxy.controller;

import com.woniuxy.entity.DrugOrderItem;
import com.woniuxy.entity.DrugRepertory;
import com.woniuxy.entity.PageBean;
import com.woniuxy.entity.ResponseResult;
import com.woniuxy.service.DrugStoreItemService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class DrugStoreItemController {

    @Resource
    DrugStoreItemService drugStoreItemService;

    @PostMapping("/rt")
    public ResponseResult<List<DrugOrderItem>> getItem(Integer repertoryId){
        System.out.println(repertoryId);

        List<DrugOrderItem> drugOrderItems=drugStoreItemService.getAllItem(repertoryId);
        ResponseResult<List<DrugOrderItem>> responseResults=new ResponseResult<>(200,"ok",drugOrderItems);

        System.out.println(responseResults);

        return responseResults;
    }
}
